package com.lijing.huffmanCode;
import java.util.Arrays;
import java.util.List;


/**
 * @Description TODO
 * @title: HuffmanCodeDemo
 * @Author LiJing
 * @Date: 2021/2/2510:40 上午
 * @Version 1.0
 */
public class HuffmanCodeDemo {
    public static void main(String[] args) {
        String str = "i like like like java do you like a java";
        byte[] contentBytes = str.getBytes();

        HuffmanCode huffmanCode = new HuffmanCode();
        byte[] b = huffmanCode.huffmanZip(contentBytes);
        System.out.println(Arrays.toString(b));
        byte[] bytes = HuffmanCode.decode(huffmanCode.getHuffmanCodes(),b);
        System.out.println(new String(bytes));

    }
}
